{{$ := .}}
<div class="btn-toolbar">
	<a class="btn btn-primary" href="{{$.DomainPath}}/admin/post"><i class="icon-plus"></i> 新文章</a>
	<div class="btn-group">
	</div>
</div>
<style type="text/css">
.post_title {font-size: 18px;}
.post_tag {background-color: #dddddd;padding: 0 4px 0 4px;font-size:12px;margin:0 0 0 0;}
.post_tag a {color:#969696;}
</style>
<div class="row-fluid">
	<div class="block span12">
		<p class="block-heading">文章列表</p>
		<div class="block-body collapse in">
			<table class="table">
				<thead>
				<tr>
					<th>标题</th>
					<th style="width:30px;">操作</th>
				</tr>
				</thead>
				<tbody>
				{{range .PostList}}
				<tr>
					<td>
						<a class="post_title" href="{{$.DomainPath}}/post/{{.Pid}}" target="_blank">{{.Title}}</a><br />
						{{range .Tags}}
						<span class="post_tag"><a href="{{$.DomainPath}}/admin/posts/tag/{{.}}">{{.}}</a></span>
						{{end}}
					</td>
					<td>
						<a href="{{$.DomainPath}}/admin/post/{{.Pid}}"><i class="icon-pencil"></i></a>
					</td>
				</tr>
				{{end}}
				</tbody>
			</table>
		</div>
	</div>
</div>
{{if getPages .MaxPage .CurrPage}}
<div class="row-fluid">
	<div class=" span12">
		<div class="pagination">
			<ul>
				<li {{if not (getPrevPage .MaxPage .CurrPage)}}class="disabled"{{end}}><a href="{{$.DomainPath}}{{$.PageUrl}}{{getPrevPage .MaxPage .CurrPage}}">&laquo;</a></li>
				{{range (getPages .MaxPage .CurrPage)}}
				<li {{if .Curr}}class="active"{{end}}><a href="{{$.DomainPath}}{{$.PageUrl}}{{.Page}}">{{.Page}}</a></li>
				{{end}}
				<li {{if not (getNextPage .MaxPage .CurrPage)}}class="disabled"{{end}}><a href="{{$.DomainPath}}{{$.PageUrl}}{{getNextPage .MaxPage .CurrPage}}">&raquo;</a></li>
			</ul>
		</div>
	</div>
</div>
{{end}}